/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214 2215
 * @Package: PACKAGE_NAME
 * @File: LoopEmbedded4.java
 * @Time: 2022/12/7 11:33
 * @Author: abcque
 * @Description: 使用循环嵌套输出菱形
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class LoopEmbedded4 {
    public static void main(String[] args) {
        for (int i = 0; i < 3; i++) {
            // 输出空白偏移
            for (int k = 0; k < 2 - i; k++) {
                System.out.print(" ");
            }
            // 输出 *
            for (int j = 0; j < 2 * i + 1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }

        for (int m = 0; m < 2; m++) {
            for (int n = 0; n <= m; n++) {
                System.out.print(" ");
            }
            for (int l = 0; l < 3 - 2 * m; l++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
